<template>
    <div class="app-container">
        <template-apply-base :view-type="2" :detail-info="detailInfo"></template-apply-base>

        <template-apply-old-template :detail-info="detailInfo"></template-apply-old-template>

        <contract-template-update :detail-info="detailInfo"></contract-template-update>
    </div>
</template>

<script>
import TemplateApplyBase from "@/views/contractTemplate/components/templateApply/templateApplyBase.vue";
import ContractTemplateUpdate from "@/views/contractTemplate/components/templateApply/contractTemplateUpdate.vue";
import TemplateApplyOldTemplate from "@/views/contractTemplate/components/templateApply/templateApplyOldTemplate.vue";

export default {
    components: {TemplateApplyOldTemplate, ContractTemplateUpdate, TemplateApplyBase},
    props:{
        value: {
            default: {},
        },
        state: {
            default: "readonly",
        },
    },
    computed:{
        detailInfo:{
            get(){
                console.log('工作流待办详情-------',this.value)
                if (this.value?.contractTemplate?.earlyReturnRules && this.value?.contractTemplate?.earlyReturnRules?.length > 0) {
                    this.value.contractTemplate.earlyReturnRules = this.value.contractTemplate.earlyReturnRules.map(item => {
                        this.$set(item, 'leaseTerm', [item.minLeaseTerm, item.maxLeaseTerm])
                        return item
                    })
                }
                return this.value;
            }
        }
    },
    methods: {
    },
    mounted() {

    },

}
</script>

<style lang="scss" scoped>

</style>
